package com.jt.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 张琪
 * @date 2020/12/2
 * @describe
 */
@RestController
public class PortController {

    @Value("${server.port}")        //动态的获取当前的端口号
    private int port;

    @RequestMapping("/getPort")
    public String getPort() {

        return "当前访问的端口号: " + port;
    }
}
